package com.copa.l2357;

import java.util.HashSet;
import java.util.Set;

/**
 * @author copa
 * @createDate 2023-02-24 14:24
 * @function set集合法
 */
public class Test1 {

    public int minimumOperations(int[] nums) {
        Set<Integer> set = new HashSet<>();
        for (int num : nums) {
            if (num != 0) {
                set.add(num);
            }
        }
        return set.size();
    }

    public static void main(String[] args) {
        //int[] nums = {1,5,0,3,5};
        int[] nums = {2, 2};
        System.out.println(new Test1().minimumOperations(nums));
    }
}
